package dr.controller;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;

public class ActionSupportLogin implements Action{
	protected static final String USER_ID = "id";
	protected static final String LOGINFORM_PATH = "/login.jsp";
	protected static final String LOGIN_PATH = "/login.jsp";
	protected static final String LOGINCHECK_PATH = "/member/loginPro.do";
	protected static final String HOME_PATH = "login.jsp";
	protected static final String LOGINULL_PATH = "/member/loginNull.jsp";
	protected static final String ADMINNULL_PATH = "/member/adminNull.jsp";
	protected static final String ACCOUNT_PATH = "/view2/accountList.do";
	
	protected String getUserLoginId(HttpServletRequest request){
		return (String)getSession(request).getAttribute(USER_ID);
	}
	protected HttpSession getSession(HttpServletRequest request){
		return request.getSession(true);
	}
	protected void removeUserId(HttpServletRequest request){
		getSession(request).removeAttribute(USER_ID);
	}
	protected void setUserId(HttpServletRequest request, String id){
		getSession(request).setAttribute(USER_ID, id);
	}
	@Override
	public String execute(HttpServletRequest request,
			HttpServletResponse response) throws Throwable {
		// TODO Auto-generated method stub
		return HOME_PATH;
	}
}
